package com.webware.one.server.domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity(name = "Person")
@Table(name = "T_PERSON")
public class Person extends AbstractEntity {
    /* ФИО */
    @Column(nullable = false, length = 1024)
    private String name;

    /* Квалифицирующий признак (собственник/арендатор/директор/бухгалтер) */
    @Column(nullable = true, length = 1024)
    private String position;

    /* Паспорт */
    @JoinColumn(nullable = true)
    @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, targetEntity = Passport.class)
    private Passport passport = null;

    public String getName() {
	return name;
    }

    public void setName(String name) {
	this.name = name;
    }

    public String getPosition() {
	return position;
    }

    public void setPosition(String position) {
	this.position = position;
    }

    public Passport getPassport() {
	return passport;
    }

    public void setPassport(Passport passport) {
	this.passport = passport;
    }

}
